Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: paths/local: Fix on-disk storage accounting in new reservations #11825

Merged
merged 1 commit into from
Apr 4, 2024

Conversation

magik6k
Copy link
Contributor

@magik6k magik6k commented Apr 4, 2024

Related Issues

Proposed Changes

Previously Reserve would instruct stat to include any sector files already on disk to lower what it consider as reserved, which in turn would lower Available storage less - The issue is that the new reservation isn't reflected in p.reserved at the time when stat is called, which means that usually we'd hit the if stat.Reserved < 0 {.. stat.Reserved = 0 condition, making the accounting inaccurate.

This PR makes stat just return how much data is on-disk for the new reservation, and shifts the accounting to the Reserve function.

Additional Info

Checklist

Before you mark the PR ready for review, please make sure that:

  • Commits have a clear commit message.
  • PR title is in the form of of <PR type>: <area>: <change being made>
    • example: fix: mempool: Introduce a cache for valid signatures
    • PR type: fix, feat, build, chore, ci, docs, perf, refactor, revert, style, test
    • area, e.g. api, chain, state, market, mempool, multisig, networking, paych, proving, sealing, wallet, deps
  • If the PR affects users (e.g., new feature, bug fix, system requirements change), update the CHANGELOG.md and add details to the UNRELEASED section.
  • New features have usage guidelines and / or documentation updates in
  • Tests exist for new functionality or change in behavior
  • CI is green

@snadrus
Copy link
Collaborator

snadrus commented Apr 4, 2024

A little more doc would be nice.

@snadrus snadrus merged commit fd64e38 into master Apr 4, 2024
185 of 186 checks passed
@snadrus snadrus deleted the fix/storage-ondisk-resv-acc branch April 4, 2024 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants